﻿@model IEnumerable<AppConfigurationMVC.Models.ConfigurationModels>

@{
    ViewBag.Title = "Application Configurations";
}

<h2>Application Configurations</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>   
        <th></th>
        <th></th>
        <th>
            Key
        </th>
        <th>
            Value
        </th>
        <th>
            Enabled
        </th>
        <th>
            ConfigReason
        </th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ConfigID })
        </td>
        <td>
            @Html.ActionLink("Delete", "Delete", new { id=item.ConfigID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ConfigKey)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ConfigValue)
        </td>
         <td>         
         @{
            if (item.ConfigEnabled)
            {
                <text>Enabled</text>
            }
            else
            {
                <text>Disabled</text>
            }                  
          }     
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ConfigReason)
        </td>        
    </tr>
}

</table>
